package com.example.app.mapper;

import com.example.app.entity.Conversation;
import org.apache.ibatis.annotations.Mapper;

import java.time.Instant;
import java.util.List;

@Mapper
public interface ConversationMapper {
    List<Conversation> getConversationsByUserId(Long userId);

    Conversation getConversationBetween(Long fromUserId, Long toUserId);

    void insertConversation(Conversation conversation);

    void updateConversationAfterMessage(Long conversationId, Long lastMessageId, String lastMessageContent,
                                        Instant lastMessageAt, Long receiverId);

}
